package com.nami.store.biz.group.application;

import com.nami.store.api.response.group.GroupDTO;
import com.nami.store.biz.group.service.GrpDomainService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.dromara.common.core.utils.StringUtils;
import org.springframework.stereotype.Service;

@Slf4j
@Service
@RequiredArgsConstructor
public class GrpAppServiceImpl implements GrpAppService {

    private final GrpDomainService grpDomainService;

    @Override
    public GroupDTO getGroup(String groupId) {
        if (StringUtils.isBlank(groupId)) {
            return null;
        }
        return grpDomainService.getGrpInfoById(groupId);
    }

    @Override
    public GroupDTO getGroup(String appId, String grpId) {
        if (StringUtils.isBlank(appId) || StringUtils.isBlank(grpId)) {
            return null;
        }
        return grpDomainService.getGrpInfo(appId, grpId);
    }
}
